﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarketOnlineDAO;
using MarketOnlineDTO;


namespace MarketOnlineBUS
{
    public class CheckBUS
    {
        public static Boolean CheckPhoneNumber(String phoneNumber)
        {
            
           
            char[] arr = phoneNumber.ToCharArray();

            for (int i = 0; i < arr.Length; i++)
            {
                if (CheckNumber(arr[i]) == false)
                    return false;

            }

            return true;
        }

        public static Boolean CheckNumber(Char c)
        {
            if (c == '0')
                return true;
            if (c == '1')
                return true;
            if (c == '2')
                return true;
            if (c == '3')
                return true;
            if (c == '4')
                return true;
            if (c == '5')
                return true;
            if (c == '6')
                return true;
            if (c == '7')
                return true;
            if (c == '8')
                return true;
            if (c == '9')
                return true;
            return false;
        }
    }
}
